<?php 
$content=$model;
$pnnavi="";

if($model->id==0){
	$hidden['collection_id']=$this->input->get('parent_id');
	$hidden['position']=$this->input->get('position');
	$collection=ORM::factory('collection', $this->input->get('parent_id'));
	$hidden['lang']=$this->session->get('lang');	
	$title='Ein neues Element aus der Collection <b>'.$collection->title.'</b> erstellen';
}else{
	
	$collection=$model->collection;
	$title='Element '.$model->title.' aus Collection '.$collection->title.' bearbeiten';
	// PREV NEXT NAVI
	
	$prevnext=$collection->get_prev_next_id($content->id);
	$plink="";
	if($prevnext[0]){
		$plink=html::anchor(CONTDIR.'collectioncontent/form/input/'.$prevnext[0], 'prev');
	}
	$nlink="";
	if($prevnext[1]){
		$nlink=html::anchor(CONTDIR.'collectioncontent/form/input/'.$prevnext[1], 'next');
	}
	
	$pnnavi='<div class="pnnavi">'.$plink.' | '.$nlink.'</div>';
	
	
}

echo '<div class="contentheader">'.$pnnavi.$title.' </div>';

if($model->id!=0){
	echo $formheader;
}

echo form::open(NULL, array(),$hidden);
echo form::open_fieldset();
eval( $collection->form);
echo form::close_fieldset();

echo myform::submit();
echo form::close();
?>